package testJdk.loops.testSwitch;

import org.junit.Test;

import java.util.Random;

/**
 * @version 1.0.0
 * Created by cyd on 2023-07-04 15:22:13
 * @ClassName : testJdk.loops.testSwitch.TestSwitch
 * @Description : 类描述
 */
public class TestSwitch {

    @Test
    public void test() {

        Random random = new Random();
        int intRandom = random.nextInt(9999);
        String str = String.valueOf(intRandom);

        switch (str.length()) {
            case 1:
                System.out.println(1);
                break;
            case 2:
                System.out.println(2);
                break;
            case 3:
                System.out.println(3);
                break;
            case 4:
                System.out.println(4);
                break;
            default:
                System.out.println("default");
                break;
        }

    }
}
